﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GpuProgramCompiler.Compilers
{
    public class VariableReplacer
    {
        public String DoVariableReplacement(String code, Dictionary<String, String> variables)
        {
            if (code != null)
            {
                foreach (String variable in variables.Keys)
                {
                    String varName = "$(" + variable + ")";
                    code = code.Replace(varName, variables[variable]);
                }
            }

            return code;
        }
    }
}
